<?php
use Illuminate\Database\Seeder;
use Illuminate\Support\Facades\DB;

/**
 * 城市列表
 *
 * @author Latrell Chan
 */
class LocationTableSeeder extends Seeder
{

	public function run()
	{
		// 导入数据。
		$file = fopen(('database/seeds/locations.sql'), 'r');
		while (($sql = fgets($file)) !== false) {
			$sql = preg_replace('/--.*/', '', $sql);
			$sql = trim($sql);
			if ($sql == '') {
				continue;
			}
			DB::insert($sql);
		}
		fclose($file);
	}
}